AND
[Logical Operator] - Returns True or False for a logic comparsion
Syntax:
argument1 AND argument2
Parameters:
argument1: any argument
argument2: another argument
Description:
Performs the Logical Conjunction and returns TRUE if and only if both arguments are TRUE.
Logicals operators are like in ZX Spectrum Basic. Their result can be either False (which is represented with 0) or True, which might be any other value. Don't expect True value number to be always 1. If you need 0/1 values for boolean evaluations, use --strict-boolean compiler option. This might add a little overhead to boolean evaluations, tough.
a | b | Result |
---|---|---|
False | False | False |
False | True | False |
True | False | False |
True | True | True |
Examples:
REM 'And LET a = -1 LET b = 17 IF a<0 AND b=17 THEN PRINT "looks like a is smaller than zero and b is equal to 17" END IF
Notes:
See also:
Supported Plattforms:
ZX Spectrum